package com.longteng.lesson2.dubbo;


import com.alibaba.fastjson.JSON;
import com.longteng.domain.User;
import com.longteng.lesson2.util.TelnetSocket;
import org.junit.Test;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class TelnetDubbo {
    @Test
    public void ls(){
        try {
            TelnetSocket telnetSocket=new TelnetSocket("47.105.55.243",20880);
//            String s =telnetSocket.send("ls");
            String cmd =telnetSocket.send("ls -l com.longteng.service.UserService");
//            telnetSocket.setReadEncoding("GBK");
            Map map=new HashMap();
            map.put("id",1);
            String param= JSON.toJSONString(map);
//            String cmd ="invoke com.longteng.service.UserService.getUser("+param+")";
            String result =telnetSocket.send(cmd);
            System.out.println(result);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
